import { createApp } from 'vue'
import { createPinia } from 'pinia'
import piniaPluginPersistedstate from 'pinia-plugin-persistedstate'

import ElementPlus from 'element-plus';
// 如果您正在使用CDN引入，请删除下面一行。
import * as ElementPlusIconsVue from '@element-plus/icons-vue'

import App from './App.vue'
import router from '@/router/index'
import type { Component } from 'vue'  // 正确的类型导入

const pinia = createPinia();
pinia.use(piniaPluginPersistedstate)

const app = createApp(App)

// 修复：为component添加类型注解
for (const [key, component] of Object.entries(ElementPlusIconsVue)) {
    app.component(key, component as Component)
}
app.use(ElementPlus);
app.use(router)
app.use(pinia);

app.mount('#app')